// ==========================================================================
// GFast自动生成model操作代码。
// 生成日期：2024-01-04 11:04:57
// 生成路径: internal/app/flow/model/flow_form.go
// 生成人：gfast
// desc:流程表单
// company:云南奇讯科技有限公司
// ==========================================================================

package model

import (
	"github.com/gogf/gf/v2/os/gtime"
	"github.com/gogf/gf/v2/util/gmeta"
	comModel "github.com/tiger1103/gfast/v3/internal/app/common/model"
	systemModel "github.com/tiger1103/gfast/v3/internal/app/system/model"
)

// FlowFormInfoRes is the golang structure for table flow_form.
type FlowFormInfoRes struct {
	gmeta.Meta  `orm:"table:flow_form"`
	Id          uint64                   `orm:"id,primary" json:"id" dc:"主键"`          // 主键
	Name        string                   `orm:"name" json:"name" dc:"表单名"`             // 表单名
	Status      int                      `orm:"status" json:"status" dc:"状态"`          // 状态
	Remark      string                   `orm:"remark" json:"remark" dc:"备注"`          // 备注
	CreatedAt   *gtime.Time              `orm:"created_at" json:"createdAt" dc:"创建时间"` // 创建时间
	UpdatedAt   *gtime.Time              `orm:"updated_at" json:"updatedAt" dc:"修改时间"` // 修改时间
	DeletedAt   *gtime.Time              `orm:"deleted_at" json:"deletedAt" dc:"删除时间"` // 删除时间
	CreatedBy   uint64                   `orm:"created_by" json:"createdBy" dc:"创建人"`  // 创建人
	CreatedUser *systemModel.LinkUserRes `orm:"with:id=created_by" json:"createdUser"`
	UpdatedBy   uint64                   `orm:"updated_by" json:"updatedBy" dc:"修改人"` // 修改人
	UpdatedUser *systemModel.LinkUserRes `orm:"with:id=updated_by" json:"updatedUser"`
	Conf        string                   `orm:"conf" json:"conf" dc:"表单配置"`     // 表单配置
	Fields      []string                 `orm:"fields" json:"fields" dc:"表单字段"` // 表单字段
}

type FlowFormListRes struct {
	Id          uint64                   `json:"id" dc:"主键"`
	Name        string                   `json:"name" dc:"表单名"`
	Status      int                      `json:"status" dc:"状态"`
	Remark      string                   `json:"remark" dc:"备注"`
	CreatedAt   *gtime.Time              `json:"createdAt" dc:"创建时间"`
	CreatedUser *systemModel.LinkUserRes `orm:"with:id=created_by" json:"createdUser"`
	CreatedBy   uint64                   `json:"createdBy" dc:"创建人"`
}

// FlowFormSearchReq 分页请求参数
type FlowFormSearchReq struct {
	comModel.PageReq
	Name      string `p:"name" dc:"表单名"`                                                          //表单名
	Status    string `p:"status" v:"status@integer#状态需为整数" dc:"状态"`                               //状态
	CreatedAt string `p:"createdAt" v:"createdAt@datetime#创建时间需为YYYY-MM-DD hh:mm:ss格式" dc:"创建时间"` //创建时间
}

// FlowFormSearchRes 列表返回结果
type FlowFormSearchRes struct {
	comModel.ListRes
	List []*FlowFormListRes `json:"list"`
}

// FlowFormAddReq 添加操作请求参数
type FlowFormAddReq struct {
	Name      string `p:"name" v:"required#表单名不能为空" dc:"表单名"`
	Status    int    `p:"status" v:"required#状态不能为空" dc:"状态"`
	Remark    string `p:"remark"  dc:"备注"`
	Conf      string `p:"conf"  dc:"表单配置"`
	Fields    string `p:"fields"  dc:"表单字段"`
	CreatedBy uint64
}

// FlowFormEditReq 修改操作请求参数
type FlowFormEditReq struct {
	Id        uint64 `p:"id" v:"required#主键ID不能为空" dc:"主键"`
	Name      string `p:"name" v:"required#表单名不能为空" dc:"表单名"`
	Status    int    `p:"status" v:"required#状态不能为空" dc:"状态"`
	Remark    string `p:"remark"  dc:"备注"`
	Conf      string `p:"conf"  dc:"表单配置"`
	Fields    string `p:"fields"  dc:"表单字段"`
	UpdatedBy uint64
}
